#ifndef CUBEPILE_H_
#define CUBEPILE_H_
#include "Cube.h"
#include "Sound.h"
#include <vector>
using namespace std;

class CubePile
{
	vector<Cube*> bouncingCubes;
	vector<Cube*> stationaryCubes;
	
	Sound * sound;
	
	bool isCollide(float aPos, float bPos, float size);
	void swapVelocities(Cube * a, Cube * b);
	void raiseHigher(Cube * a, Cube * b);
	void raiseAOverB(Cube * a, Cube * b);
	void handleCollision(Cube * a, Cube * b, float timeD);
	void testAndHandleCollisions(float timeD);
	void moveStillCubesFromBounceList();
	
public:
	CubePile(Cube * bottomCube, Sound * aSound);
	virtual ~CubePile();
	void dropCube(Cube* cube);
	Cube * popCube();
	Cube * peekAtTop();
	void animate(float timeD);
	void render();
	int size();
};

#endif /*CUBEPILE_H_*/
